﻿using Brc_PaaS.Api.Common;
using Brc_PaaS.Api.Filters;
using Brc_PaaS.Bll.RabbitMq;
using Brc_PaaS.Bll.System;
using Brc_PaaS.Common.Model.Basic;
using Brc_PaaS.Common.Model.RabbitMq;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System;
using System.Net;
using System.Net.Http;

namespace Brc_PaaS.Api.PaaSController
{
    [Route("PaaS/[controller]/[action]")]
    [ApiController]
    [EnableCors("any")]
    [ApiExplorerSettings(GroupName = "PaaSBasic")]
    public class PaaSRabbitMqBasicController : AdminBaseController
    {
        private readonly IRabbitMqBasicManager rabbitMqBasicManager;

        public PaaSRabbitMqBasicController(IConfiguration configuration, IRabbitMqBasicManager rabbitMqBasicManager) :base(configuration)
        {
            this.rabbitMqBasicManager = rabbitMqBasicManager;
        }
        /// <summary>
        /// 创建RabbitMq
        /// </summary>
        /// <param name="systemId"></param>
        /// <returns></returns>
        [HttpPost]
        public ActionResult<ResponseModel<RabbitMqBasicInfoDto>> CreateRabbitMq(string systemId)
        {
          var result =  rabbitMqBasicManager.CreateRabbitMq(systemId, AccountId);
            return Ok(result);
        }
    }
}